Monitoring and resolving deadlocks, contention, runaway CPU and other virtual machine production issues

ABSTRACT

Resolving virtual machine (VM) issues, by executing VM and operating system (OS) diagnostic monitors, including, monitoring a set of VM and OS health status metrics of a system at a first level, analyzing data of the monitored health status metrics to determine that an instability has occurred when the data exceeds defined bounds for the health status metrics, responding to the instability by monitoring additional VM and OS health status metrics, whereby a level of monitoring of the system is increased from the first level to a second level, greater than the first level, identifying the instability, repairing the system by taking corrective action based on the identified instability; and removing at least one of the set of monitoring and profiling tools to reduce the level of monitoring to a third level once the instability has been resolved, wherein the third level is less than the second level.

BACKGROUND

Embodiments described herein generally relate to the field of computersoftware. In particular, embodiments of the invention relate tomonitoring, detecting, and resolving virtual machine production issues.

SUMMARY

Embodiments described herein provide a computer-implemented method, acomputer program product, and a system for resolving virtual machine(VM) issues by executing virtual machine (VM) and operating system (OS)diagnostic monitors, including, monitoring a set of VM and OS healthstatus metrics of a system at a first level, analyzing data of themonitored health status metrics to determine that an instability hasoccurred when the data exceeds defined bounds for the health statusmetrics, responding to the instability by monitoring additional VM andOS health status metrics, whereby a level of monitoring of the system isincreased from the first level to a second level, greater than the firstlevel, identifying the instability, repairing the system by takingcorrective action based on the identified instability; and removing atleast one of the set of monitoring and profiling tools to reduce thelevel of monitoring to a third level once the instability has beenresolved, wherein the third level is less than the second level.

BRIEF DESCRIPTION OF THE DRAWINGS

So that the manner in which the above recited aspects are attained andcan be understood in detail, a more particular description ofembodiments, briefly summarized above, may be had by reference to theappended drawings.

It is to be noted, however, that the appended drawings illustrate onlytypical embodiments and are therefore not to be considered limiting ofits scope, for the invention may admit to other equally effectiveembodiments.

FIG. 1 is a block diagram illustrating one embodiment of a computersystem running a virtual machine.

FIG. 2 is a flowchart illustrating a method for monitoring and resolvingvirtual machine production issues, according to one embodiment describedherein.

FIG. 3 is a flowchart illustrating initialization of an exemplaryvirtual machine tool interface agent, according to one embodimentdescribed herein.

FIG. 4 is a flowchart illustrating a method for monitoring and repairingvirtual machine and operating system health status metrics.

FIG. 5 is a flowchart illustrating a method for repairing virtualmachine and operating system health status metrics, according to oneembodiment described herein.

FIG. 6 depicts a cloud computing environment according to one embodimentdescribed herein.

FIG. 7 depicts abstraction model layers according to one embodimentdescribed herein.

DETAILED DESCRIPTION

Currently, computer software applications may be deployed on servers orclient computers. Some applications may be executed within anenvironment provided by a virtual machine (VM). A virtual machineprovides an abstract specification for a computing device that may beimplemented in different ways. The virtual machine allows a computerprogram or application to run on any computer platform, regardless ofthe underlying hardware. Applications compiled for the virtual machinemay be executed on any underlying computer system, provided that aversion of the virtual machine is available. Typically, the virtualmachine is implemented in software rather than hardware and is oftenreferred to as a “runtime environment.” In general, the virtual machineexecutes an application by generating instructions from the source codethat may then be performed by a physical processor available on theunderlying computer system.

One well known example of a virtual machine is the Java virtual machine,available from Oracle Corporation. (Java and all Java-based trademarksand logos are trademarks or registered trademarks of Oracle and/or itsaffiliates.) The Java virtual machine (JVM) consists of a bytecodeinstruction set, a set of registers, a stack, a garbage-collected heap(i.e., memory space for user applications), and a memory space forstoring methods. Source code compiled for a Java virtual machine istypically referred to as “bytecode.” Applications written in the Javaprogramming language may be compiled to generate bytecodes. Thebytecodes provide the platform-independent code interpreted by the Javavirtual machine.

A virtual machine, like any computing environment, inevitably willsuffer from performance health issues. Current approaches for detectingand resolving VM health issues like deadlocks, hangs, and high processorutilization are very intrusive. These approaches involve instrumentationand profiling of code, transformation of class files, and heap walking,which make use of a VM tool interface (VMTI). The improved VMTI agentdisclosed herein provides a way to inspect the state of the system andvirtual machine and to control the execution of applications running inthe VM.

Much of the raw data comprising health status metrics comes either fromthe OS or the VM. Current tools for profiling, debugging, monitoring,and thread analysis do not take all of this information into accountwhen repairing the VM. Profiling is a form of dynamic program analysiswhich investigates a program's behavior as it executes. A profiler may,for example, monitor processor (CPU) and memory usage during programexecution, and the results are used to identify code portions of theprogram which may be optimized due to poor runtime performance. Thecurrent tools also fail to combine the OS and VM health metrics toprovide a unified solution considering the entire state of the system.The lack of a unified solution is exacerbated when multiple VMs aredeployed on the same system in the cloud, where a solution addressingthe system as a whole would be more advantageous than a piece by piecesolution (i.e., VM to VM), which may produce conflicting results.

Embodiments described herein provide a VMTI agent configured to enableVM and OS diagnostics in a holistic manner to repair a VM from acritical state by dynamically adding or removing monitoring andprofiling points at runtime. The VMTI agent thus only adds monitoringand profiling points when necessary, i.e., in response to a detectedinstability, and removes them once the instability has been resolved.For example, the VMTI agent can add tools which monitor CPU and memoryutilization, and remove the tools when the system state returns tonormal. The VMTI agent monitors the underpinnings of VM and OSactivities, such as processor and memory utilization, and takescorrective action based on these monitored health status metrics. Thedynamic nature of the VMTI agent allows the agent to take itself in andout of the system as needed with the goal of keeping profiler costs at aminimum.

In the following, reference is made to embodiments of the invention.However, it should be understood that the invention is not limited tospecific described embodiments. Instead, any combination of thefollowing features and elements, whether related to differentembodiments or not, is contemplated to implement and practice theinvention. Furthermore, although embodiments of the invention mayachieve advantages over other possible solutions and/or over the priorart, whether or not a particular advantage is achieved by a givenembodiment is not limiting of the invention. Thus, the followingaspects, features, embodiments and advantages are merely illustrativeand are not considered elements or limitations of the appended claimsexcept where explicitly recited in a claim(s). Likewise, reference to“the invention” shall not be construed as a generalization of anyinventive subject matter disclosed herein and shall not be considered tobe an element or limitation of the appended claims except whereexplicitly recited in a claim(s).

As will be appreciated by one skilled in the art, aspects of the presentinvention may be embodied as a system, method or computer programproduct. Accordingly, aspects of the present invention may take the formof an entirely hardware embodiment, an entirely software embodiment(including firmware, resident software, micro-code, etc.) or anembodiment combining software and hardware aspects that may allgenerally be referred to herein as a “circuit,” “module” or “system.”Furthermore, aspects of the present invention may take the form of acomputer program product embodied in one or more computer readablemedium(s) having computer readable program code embodied thereon.

Any combination of one or more computer readable medium(s) may beutilized. The computer readable medium may be a computer readable signalmedium or a computer readable storage medium. A computer readablestorage medium may be, for example, but not limited to, an electronic,magnetic, optical, electromagnetic, infrared, or semiconductor system,apparatus, or device, or any suitable combination of the foregoing. Morespecific examples (a non-exhaustive list) of the computer readablestorage medium would include the following: an electrical connectionhaving one or more wires, a portable computer diskette, a hard disk, arandom access memory (RAM), a read-only memory (ROM), an erasableprogrammable read-only memory (EPROM or Flash memory), an optical fiber,a portable compact disc read-only memory (CD-ROM), an optical storagedevice, a magnetic storage device, or any suitable combination of theforegoing. In the context of this document, a computer readable storagemedium may be any tangible medium that can contain, or store a programfor use by or in connection with an instruction execution system,apparatus, or device.

A computer readable signal medium may include a propagated data signalwith computer readable program code embodied therein, for example, inbaseband or as part of a carrier wave. Such a propagated signal may takeany of a variety of forms, including, but not limited to,electro-magnetic, optical, or any suitable combination thereof. Acomputer readable signal medium may be any computer readable medium thatis not a computer readable storage medium and that can communicate,propagate, or transport a program for use by or in connection with aninstruction execution system, apparatus, or device.

Program code embodied on a computer readable medium may be transmittedusing any appropriate medium, including but not limited to wireless,wireline, optical fiber cable, RF, etc., or any suitable combination ofthe foregoing.

Computer program code for carrying out operations for aspects of thepresent invention may be written in any combination of one or moreprogramming languages, including an object oriented programming languagesuch as Java, Smalltalk, C++ or the like and conventional proceduralprogramming languages, such as the “C” programming language or similarprogramming languages. The program code may execute entirely on theuser's computer, partly on the user's computer, as a stand-alonesoftware package, partly on the user's computer and partly on a remotecomputer or entirely on the remote computer or server. In the latterscenario, the remote computer may be connected to the user's computerthrough any type of network, including a local area network (LAN) or awide area network (WAN), or the connection may be made to an externalcomputer (for example, through the Internet using an Internet ServiceProvider).

Aspects of the present invention are described below with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems) and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer program instructions. These computer program instructions maybe provided to a processor of a general purpose computer, specialpurpose computer, or other programmable data processing apparatus toproduce a machine, such that the instructions, which execute via theprocessor of the computer or other programmable data processingapparatus, create means for implementing the functions/acts specified inthe flowchart and/or block diagram block or blocks.

These computer program instructions may also be stored in a computerreadable medium that can direct a computer, other programmable dataprocessing apparatus, or other devices to function in a particularmanner, such that the instructions stored in the computer readablemedium produce an article of manufacture including instructions whichimplement the function/act specified in the flowchart and/or blockdiagram block or blocks.

The computer program instructions may also be loaded onto a computer,other programmable data processing apparatus, or other devices to causea series of operational steps to be performed on the computer, otherprogrammable apparatus or other devices to produce a computerimplemented process such that the instructions which execute on thecomputer or other programmable apparatus provide processes forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks.

Embodiments of the invention may be provided to end users through acloud computing infrastructure. Cloud computing generally refers to theprovision of scalable computing resources as a service over a network.More formally, cloud computing may be defined as a computing capabilitythat provides an abstraction between the computing resource and itsunderlying technical architecture (e.g., servers, storage, networks),enabling convenient, on-demand network access to a shared pool ofconfigurable computing resources that can be rapidly provisioned andreleased with minimal management effort or service provider interaction.Thus, cloud computing allows a user to access virtual computingresources (e.g., storage, data, applications, and even completevirtualized computing systems) in “the cloud,” without regard for theunderlying physical systems (or locations of those systems) used toprovide the computing resources.

Typically, cloud computing resources are provided to a user on apay-per-use basis, where users are charged only for the computingresources actually used (e.g. an amount of storage space consumed by auser or a number of virtualized systems instantiated by the user). Auser can access any of the resources that reside in the cloud at anytime, and from anywhere across the Internet. In context of the presentinvention, a user may access applications such as the VMTI agent orrelated data available in the cloud. For example, the VMTI agent couldexecute on a computing system in the cloud and monitor and repaircritical system errors. In such a case, the VMTI agent could monitor andcorrect critical system errors and store VMTI agent log data at astorage location in the cloud. Doing so allows a user to access thisinformation from any computing system attached to a network connected tothe cloud (e.g., the Internet).

It is understood in advance that although this disclosure includes adetailed description on cloud computing, implementation of the teachingsrecited herein are not limited to a cloud computing environment. Rather,embodiments described herein are capable of being implemented inconjunction with any other type of computing environment now known orlater developed.

For convenience, the Detailed Description includes the followingdefinitions which have been derived from the “Draft NIST WorkingDefinition of Cloud Computing” by Peter Mell and Tim Grance, dated Oct.7, 2009, which is cited in an IDS filed herewith, and a copy of which isattached thereto.

Cloud computing is a model of service delivery for enabling convenient,on-demand network access to a shared pool of configurable computingresources (e.g. networks, network bandwidth, servers, processing,memory, storage, applications, virtual machines, and services) that canbe rapidly provisioned and released with minimal management effort orinteraction with a provider of the service. This cloud model may includeat least five characteristics, at least three service models, and atleast four deployment models.

Characteristics are as Follows:

On-demand self-service: a cloud consumer can unilaterally provisioncomputing capabilities, such as server time and network storage, asneeded automatically without requiring human interaction with theservice's provider.

Broad network access: capabilities are available over a network andaccessed through standard mechanisms that promote use by heterogeneousthin or thick client platforms (e.g., mobile phones, laptops, and PDAs).

Resource pooling: the provider's computing resources are pooled to servemultiple consumers using a multi-tenant model, with different physicaland virtual resources dynamically assigned and reassigned according todemand. There is a sense of location independence in that the consumergenerally has no control or knowledge over the exact location of theprovided resources but may be able to specify location at a higher levelof abstraction (e.g., country, state, or datacenter).

Rapid elasticity: capabilities can be rapidly and elasticallyprovisioned, in some cases automatically, to quickly scale out andrapidly released to quickly scale in. To the consumer, the capabilitiesavailable for provisioning often appear to be unlimited and can bepurchased in any quantity at any time.

Measured service: cloud systems automatically control and optimizeresource use by leveraging a metering capability at some level ofabstraction appropriate to the type of service (e.g., storage,processing, bandwidth, and active user accounts). Resource usage can bemonitored, controlled, and reported providing transparency for both theprovider and consumer of the utilized service.

Service Models are as Follows:

Software as a Service (SaaS): the capability provided to the consumer isto use the provider's applications running on a cloud infrastructure.The applications are accessible from various client devices through athin client interface such as a web browser (e.g., web-based e-mail).The consumer does not manage or control the underlying cloudinfrastructure including network, servers, operating systems, storage,or even individual application capabilities, with the possible exceptionof limited user-specific application configuration settings.

Platform as a Service (PaaS): the capability provided to the consumer isto deploy onto the cloud infrastructure consumer-created or acquiredapplications created using programming languages and tools supported bythe provider. The consumer does not manage or control the underlyingcloud infrastructure including networks, servers, operating systems, orstorage, but has control over the deployed applications and possiblyapplication hosting environment configurations.

Infrastructure as a Service (IaaS): the capability provided to theconsumer is to provision processing, storage, networks, and otherfundamental computing resources where the consumer is able to deploy andrun arbitrary software, which can include operating systems andapplications. The consumer does not manage or control the underlyingcloud infrastructure but has control over operating systems, storage,deployed applications, and possibly limited control of select networkingcomponents (e.g., host firewalls).

Deployment Models are as Follows:

Private cloud: the cloud infrastructure is operated solely for anorganization. It may be managed by the organization or a third party andmay exist on-premises or off-premises.

Community cloud: the cloud infrastructure is shared by severalorganizations and supports a specific community that has shared concerns(e.g., mission, security requirements, policy, and complianceconsiderations). It may be managed by the organizations or a third partyand may exist on-premises or off-premises.

Public cloud: the cloud infrastructure is made available to the generalpublic or a large industry group and is owned by an organization sellingcloud services.

Hybrid cloud: the cloud infrastructure is a composition of two or moreclouds (private, community, or public) that remain unique entities butare bound together by standardized or proprietary technology thatenables data and application portability (e.g., cloud bursting forload-balancing between clouds).

A cloud computing environment is service oriented with a focus onstatelessness, low coupling, modularity, and semantic interoperability.At the heart of cloud computing is an infrastructure comprising anetwork of interconnected nodes.

FIG. 1 is a block diagram illustrating a system 100 for monitoring andrepairing virtual machine production issues, according to one embodimentof the invention. The networked system 100 includes a computer 102. Thecomputer 102 may also be connected to other computers via a network 130.In general, the network 130 may be a telecommunications network and/or awide area network (WAN). In a particular embodiment, the network 130 isthe Internet.

The computer 102 generally includes a processor 104 connected via a bus120 to a memory 106, a network interface device 118, a storage 114, aninput device 122, and an output device 124. The computer 102 isgenerally under the control of an operating system. Examples ofoperating systems include the UNIX operating system, versions of theMicrosoft Windows operating system, and distributions of the Linuxoperating system. (UNIX is a registered trademark of The Open Group inthe United States and other countries. Microsoft and Windows aretrademarks of Microsoft Corporation in the United States, othercountries, or both. Linux is a registered trademark of Linus Torvalds inthe United States, other countries, or both.) More generally, anyoperating system supporting the functions disclosed herein may be used.The processor 104 is included to be representative of a single CPU,multiple CPUs, a single CPU having multiple processing cores, and thelike. Similarly, the memory 106 may be a random access memory. While thememory 106 is shown as a single identity, it should be understood thatthe memory 106 may comprise a plurality of modules, and that the memory106 may exist at multiple levels, from high speed registers and cachesto lower speed but larger DRAM chips. The network interface device 118may be any type of network communications device allowing the computer102 to communicate with other computers via the network 130.

The storage 114 may be a persistent storage device. Although the storage114 is shown as a single unit, the storage 114 may be a combination offixed and/or removable storage devices, such as fixed disc drives, solidstate drives, floppy disc drives, tape drives, removable memory cards oroptical storage. The memory 106 and the storage 114 may be part of onevirtual address space spanning multiple primary and secondary storagedevices. As shown, storage 114 contains a VMTI agent log 116, in whichthe VMTI agent stores event data, described in further detail below.

The input device 122 may be any device for providing input to thecomputer 102. For example, a keyboard and/or a mouse may be used. Theoutput device 124 may be any device for providing output to a user ofthe computer 102. For example, the output device 124 may be anyconventional display screen or set of speakers. Although shownseparately from the input device 122, the output device 124 and inputdevice 122 may be combined. For example, a display screen with anintegrated touch-screen may be used.

In one embodiment, one or more virtual machine(s) 110 may reside withinmemory 106. Each virtual machine 110 running on computer system 100 isconfigured to execute software applications created for the virtualmachine 110. For example, the virtual machine 110 may comprise the Javavirtual machine and operating environment created according to the Javavirtual machine specifications. Although embodiments described hereinmay reference the Java virtual machine as an example, embodiments may beimplemented in any virtual machine environment. Finally, memory 106 alsocontains VMTI agent 112. Generally, VMTI agent 112 watches for excessivemonitor contention, and when it determines that some monitors are beingused proportionally more than others, it starts to “watch” thosemonitors more closely to identify a problem. A monitor controls accessto an object intended to be used by more than one thread. At any givenpoint in time, at most one thread may have access to a monitor and theobject the monitor controls. By operating in this manner, the initialoverhead of VMTI agent 112 is kept to a minimum, and VMTI agent 112increases its overhead only if there is a system or VM instability. Forexample, the VMTI agent 112 may monitor the heap only when the heaputilization level crosses a specified threshold. The metrics monitoredby the VMTI agent 112 should be understood to include any possiblehealth status metric associated with a VM and operating system.

FIG. 2 is a flowchart illustrating a method 200 for monitoring,detecting, and repairing virtual machine production issues, according toone embodiment. The method begins at step 210, described in greaterdetail with reference to FIG. 3 below, where the VMTI agent 112 isinitialized upon startup of the virtual machine. At step 220, describedin greater detail with reference to FIG. 4 below, the VMTI agent 112begins monitoring VM and OS health status metrics. The metrics monitoredmay be specified by a user, or may be system default metrics. Themetrics may also be based on monitoring patterns under similarconditions as specified in VMTI agent log 116. At step 230, the VMTIagent 112 detects an instability, whereupon at step 240, the VMTI agent112 increases its monitoring level. An instability may be associatedwith any hardware or software component of the computer, or any elementof the VM or OS. In one embodiment, VMTI agent 112 detects aninstability when a metric being monitored exceeds a specified threshold.An increase in the monitoring level is achieved by adding new monitorsor profiling points in response to the particular instability detected.In some embodiments, the VMTI agent 112 selects the additional monitorsand profiling points based on patterns found to be successful undersimilar circumstances as specified in the VMTI agent log 116. Byincreasing the monitoring level, the VMTI agent 112 is more likely todetect the cause of the instability, and thus find a proper solution.The method proceeds to step 250, where the VMTI agent 112 repairs thesystem. In some embodiments, the VMTI agent 112 selects methods forrepair based on patterns determined to be successful under similarcircumstances in the VMTI agent log 116. In other embodiments, standardrepair methods are implemented which correspond to the detectedinstability. At step 260, the VMTI agent 112 reduces its monitoringlevel. At step 270, the VMTI agent 112 writes log data to the VMTI agentlog 116.

Embodiments of VMTI agent log 116 may include, but are not limited to,data related to the initial set of health status metrics monitored,detected instabilities, additional health status metric monitors addedin response to the instability, corrective actions taken, whether thecorrective actions were successful, and health status metrics no longermonitored upon correction of the instability. More generally, the VMTIagent log 116 may include any information related to performance of theVMTI agent 112.

FIG. 3 is a flowchart illustrating a method 300 corresponding to step210 for initializing the VMTI agent 112, according to one embodiment.The method begins at 310, where a VM is started. At step 320, the methoddetermines whether a user has defined custom parameters for the VMTIagent 112. Exemplary parameters include, but are not limited to, maximumCPU utilization, maximum memory utilization, response time overhead,number of previous recommendations made, quality assessment of the user,and the type of monitoring to be implemented. If no user parameters havebeen defined, the VMTI agent 112 may be configured to supply defaultparameters, and the method proceeds to step 340. If the user has definedparameters, the method proceeds to step 330, where the user definedparameters are passed as variables to the VMTI agent 112, and the methodproceeds to step 340. At step 340, the VMTI agent 112 is initialized,and the VMTI agent 112 uses the supplied parameters to begin monitoringthe parameterized set of health status metrics. Once initialized, theVMTI agent 112 monitors the health status metrics specified by theparameters.

FIG. 4 is a flowchart illustrating a method 400 corresponding to step220 for monitoring VM and OS health status metrics. The method begins atstep 410, where the VMTI agent 112 monitors VM and OS health statusmetrics at a first level. In one embodiment, the first level includesdefault health status metrics to be monitored, examples of whichinclude, but are not limited to CPU utilization, memory utilization,system network activity, and system input/output interface utilization.In another embodiment, the first level includes health status metricsdefined by the system user. In yet another embodiment, the first levelincludes health status metrics ascertained by the VMTI agent 112 throughthe use of machine learning, where the VMTI agent 112 intelligentlydetermines which health status metrics to monitor based on past systemhealth as indicated in the VMTI agent log 116. In still anotherembodiment, the VMTI agent 112 may monitor no health status metricsduring times of system standby. Disabling all health status metricsduring periods of system standby is premised on the assumption that asystem in a standby state will not be subject to runtime issues.

The method then proceeds to step 420, where the VMTI agent 112 detectsthat an instability has occurred. For instance, an instability hasoccurred when health status metrics exceed the bounds defined by theVMTI agent 112 or the user. In another embodiment, the VMTI providessupport for forced early return from a method to try to limit the damageto the rest of the system and notifies the VM when a critical resource,such as the VM platform heap, has been exhausted. The VMTI agent 112 canutilize this information to determine that an instability has occurred.The method then proceeds to step 430, where the VMTI agent 112 monitorsVM and OS health status metrics at a second level, where the VMTI agent112 dynamically enables monitoring of additional health status metricsnot included at the first monitoring level. In one embodiment, thehealth status metrics monitored at the second level are executed basedon the nature of the system instability. For example, if memoryutilization is high, the VMTI agent 112 may monitor health statusmetrics related to the system memory. In another embodiment, the VMTIagent 112 leverages machine learning to determine what health statusmetrics to monitor based on similar instabilities recorded in the VMTIagent log 116. The VMTI agent 112 may identify patterns of previoussystem behavior stored in VMTI agent log 116 to determine which healthstatus metrics to monitor. For example, if the VMTI agent 112 identifiesa pattern of high CPU utilization in VMTI agent log 116 similar to thecurrent instability, the VMTI agent 112 may identify the CPU metricsmonitored in VMTI agent log 116 and apply them to address the currentinstability. In yet another embodiment, the VMTI agent 112 monitors userdefined health status metrics in response to the particular instability.

The method proceeds to step 440, described in further detail below,where the VMTI agent 112 takes corrective action in an attempt to repairthe system and return it to a healthy state. In some embodiments, thecorrective action taken is directly related to the identifiedinstability. In other embodiments, the corrective action may bedetermined by detecting a successful pattern in VMTI agent log 116. Themethod then proceeds to step 450, where the VMTI agent 112 determineswhether the instability has been corrected. If the instability has beencorrected, the method proceeds to step 460. If the instability has notbeen corrected, the method returns to step 430, where the VMTI agent 112continues to monitor at the second level, according to one embodiment.In another embodiment, the VMTI agent 112 may dynamically monitoradditional health status metrics. At step 460, the VMTI agent 112dynamically removes monitoring tools to return to a third level ofmonitoring. In some embodiments, the third monitoring level may begreater than, less than, or equal to the first and second monitoringlevels. The VMTI agent 112 continues monitoring at this third leveluntil an instability is detected and the method returns to step 420. Inone embodiment, the third level comprises the VMTI agent 112 removingitself from the system, such that it does not monitor any health statusmetrics during periods of system health or system standby.

For example, at step 410, the VMTI agent 112 detects that a networkconnection has not responded for a long period of time. At step 420, theVMTI agent 112 detects this issue using nonintrusive background timers.At step 430, the VMTI agent 112 increases monitoring on that particularnetwork connection by seeing if there are any bytes coming in or goingout of that connection. At step 440, the VMTI agent 112 may then decideto terminate that connection and force an early return. If these actionsare not successful, at step 460, the VMTI agent may add additionalinstrumentation to any new connections established to the samedestination to log the initial data sent to the destination. If theissue continues, the VMTI agent 112 may again take corrective action atstep 440, but at that point the VMTI agent 112 will have additional datalogged about why the connection continuously takes too long.

In some embodiments, the different monitoring levels are defined by theoutput of a function in the VMTI agent 112. In one embodiment, thefunction accepts user defined parameters, as in step 330 of method 300.In another embodiment, system default parameters are supplied. In oneembodiment, the output of the function is an actual set of nativefunctions, which have been parameterized and set as the monitors. Inanother embodiment, the output is a set of pseudo-instructions sent to aprocessor which then applies them to the VMTI agent 112. The output ofthe function will allow the VMTI agent 112 to compare overhead anddecide the relative value of each health status metric in an effort tominimize profiling costs. For example, the user specifies what type ofmonitoring they prefer the most (such as operating system monitoring andnetwork monitoring) and they specify that maximum overhead. Based onthis information, the VMTI agent 112 uses mathematical algorithms tofind the set of monitoring which achieves the user's goals (as closelyas possible) while still staying below the desired overhead. Theoverhead of this decision is monitored and the monitoring rules aremodified at runtime to ensure compliance. For example, if the userspecifies a goal that no transaction should take longer than X secondsbut that the overhead of monitoring should be less than 1%, the VMTIagent 112 may decide to do the minimal amount of work to monitortransactions, which would mean that the log of a long transaction maynot say what part of the transaction took the longest, but the overheadgoal would still be achieved and the user can change the goals, ifnecessary, to further diagnose the issue.

FIG. 5 is a flowchart corresponding to step 250 for repairinginstabilities. The method begins at step 510, where the nature of theinstability is determined based on collected health status metrics.Examples of the nature of the instability include, but are not limitedto, CPU utilization, memory utilization, VM stack errors, and VM threaderrors. The method then proceeds to step 520, where the VMTI agent 112checks VMTI agent log 116 for patterns of similar instabilities. Themethod proceeds to step 530, where the VMTI agent 112 determines whethera similar instability exists. If no similarity exists, the methodproceeds to step 560. If a similarity exists, the method proceeds tostep 540, where the VMTI agent 112 identifies prior corrective actionstaken in the VMTI agent log 116. Then, at step 550, the VMTI agent 112determines whether the prior corrective actions identified at step 540were successful in repairing the system instability. If the correctiveaction was successful, the method proceeds to step 560. If thecorrective action was not successful, the method returns to step 520 todetermine if different corrective actions were taken, via the VMTI agentlog 116.

At step 560, the VMTI agent 112 suggests an action as the correctiveaction. In one embodiment, the corrective action is the one identifiedat step 550. In another embodiment, the VMTI agent 112 suggestscorrective action based on default corrective actions correlated to thenature of the instability identified at step 510. Exemplary correctiveactions include, but are not limited to, interrupting threads,increasing connection pool sizes, and forcing garbage collection. Atstep 570, the VMTI agent 112 determines whether a user must authorizethe actions. If user authorization is not required, the method proceedsto step 595. If user authorization is required, the method proceeds tostep 580 where the user is presented with the corrective action forauthorization. If the user authorizes the corrective action, the methodproceeds to step 590. If the user does not authorize the correctiveaction, the method returns to step 520. At step 590, the VMTI agent 112takes the corrective action in an attempt to repair the system.

At step 595, the VMTI agent 112 determines whether the corrective actiontaken was successful. In one embodiment, the VMTI agent 112 determinesthat the corrective action taken was successful by continuing to monitorhealth status metrics and analyze the resultant data. In anotherembodiment, a user may provide input as to whether the correctiveactions taken were successful. If the corrective actions were notsuccessful, the method may return to step 520. In another embodiment,method 500 ends and the system continues monitoring health statusmetrics.

Referring now to FIG. 6, illustrative cloud computing environment 650 isdepicted. As shown, cloud computing environment 650 comprises one ormore cloud computing nodes 610 with which local computing devices usedby cloud consumers, such as, for example, personal digital assistant(PDA) or cellular telephone 654A, desktop computer 654B, laptop computer654D, and/or automobile computer system 654N may communicate. Nodes 610may communicate with one another. They may be grouped (not shown)physically or virtually, in one or more networks, such as Private,Community, Public, or Hybrid clouds as described hereinabove, or acombination thereof. This allows cloud computing environment 650 tooffer infrastructure, platforms and/or software as services for which acloud consumer does not need to maintain resources on a local computingdevice. It is understood that the types of computing devices 654A-Nshown in FIG. 6 are intended to be illustrative only and that computingnodes 610 and cloud computing environment 650 can communicate with anytype of computerized device over any type of network and/or networkaddressable connection (e.g., using a web browser).

Referring now to FIG. 7, a set of functional abstraction layers providedby cloud computing environment 650 (FIG. 6) is shown. It should beunderstood in advance that the components, layers, and functions shownin FIG. 7 are intended to be illustrative only and embodiments of theinvention are not limited thereto. As depicted, the following layers andcorresponding functions are provided:

Hardware and software layer 760 includes hardware and softwarecomponents. Examples of hardware components include mainframes, in oneexample IBM® zSeries® systems; RISC (Reduced Instruction Set Computer)architecture based servers, in one example IBM pSeries® systems; IBMxSeries® systems; IBM BladeCenter® systems; storage devices; networksand networking components. Examples of software components includenetwork application server software, in one example IBM WebSphere®application server software; and database software, in one example IBMDB2® database software. (IBM, zSeries, pSeries, xSeries, BladeCenter,WebSphere, and DB2 are trademarks of International Business MachinesCorporation registered in many jurisdictions worldwide).

Virtualization layer 762 provides an abstraction layer from which thefollowing examples of virtual entities may be provided: virtual servers;virtual storage; virtual networks, including virtual private networks;virtual applications and operating systems; and virtual clients.

In one example, management layer 764 may provide the functions describedbelow. Resource provisioning provides dynamic procurement of computingresources and other resources that are utilized to perform tasks withinthe cloud computing environment. Metering and Pricing provide costtracking as resources are utilized within the cloud computingenvironment, and billing or invoicing for consumption of theseresources. In one example, these resources may comprise applicationsoftware licenses. Security provides identity verification for cloudconsumers and tasks, as well as protection for data and other resources.User portal provides access to the cloud computing environment forconsumers and system administrators. Service level management providescloud computing resource allocation and management such that requiredservice levels are met. Service Level Agreement (SLA) planning andfulfillment provide pre-arrangement for, and procurement of, cloudcomputing resources for which a future requirement is anticipated inaccordance with an SLA.

Workloads layer 766 provides examples of functionality for which thecloud computing environment may be utilized. Examples of workloads andfunctions which may be provided from this layer include: mapping andnavigation; software development and lifecycle management; virtualclassroom education delivery; data analytics processing; transactionprocessing; and monitoring and repair of critical system errors.

The flowchart and block diagrams in the Figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof code, which comprises one or more executable instructions forimplementing the specified logical function(s). It should also be notedthat, in some alternative implementations, the functions noted in theblock may occur out of the order noted in the figures. For example, twoblocks shown in succession may, in fact, be executed substantiallyconcurrently, or the blocks may sometimes be executed in the reverseorder, depending upon the functionality involved. It will also be notedthat each block of the block diagrams and/or flowchart illustration, andcombinations of blocks in the block diagrams and/or flowchartillustration, can be implemented by special purpose hardware-basedsystems that perform the specified functions or acts, or combinations ofspecial purpose hardware and computer instructions.

While the foregoing is directed to embodiments of the present invention,other and further embodiments of the invention may be devised withoutdeparting from the basic scope thereof, and the scope thereof isdetermined by the claims that follow.

What is claimed is:
 1. A computer program product, comprising: acomputer-readable storage medium having computer-readable program codeembodied therewith, the computer-readable program code comprising:computer-readable program code configured to monitor a set of healthstatus metrics of a virtual machine at a first level; computer-readableprogram code configured to analyze data of the monitored health statusmetrics to determine that an instability has occurred when the dataexceeds defined bounds for the computing system health status metrics;computer-readable program code configured to respond to the instabilityby monitoring additional health status metrics, whereby a level ofmonitoring of the system is increased from the first level to a secondlevel, greater than the first level; computer-readable program codeconfigured to repair the system by taking corrective action based on theinstability; and computer-readable program code configured to stopmonitoring at least one of the set of monitored health status metrics toreduce the level of monitoring to a third level once the instability hasbeen resolved, wherein the third level is less than the second level. 2.The computer program product of claim 1, wherein a user defines the setsof health status metrics to be monitored and the bounds used todetermine that an instability has occurred.
 3. The computer programproduct of claim 1, wherein the health status metrics monitored at thefirst level of monitoring comprise health status metrics of a centralprocessing unit (CPU), a system memory, a system network activity, and asystem input/output interface.
 4. The computer program product of claim1, wherein monitoring further comprises: monitoring no health statusmetrics during a period of system stability.
 5. The computer programproduct of claim 1, further comprising computer-readable program codeconfigured to write to a system log the additional health status metricsmonitored, the instability, the corrective action taken, and anassociated effect on system stability for future use, wherein the systemlog is referenced to identify the health status metrics monitored andcorrective actions taken to repair similar instabilities such thateffective actions are repeated, and ineffective actions are notrepeated.
 6. The computer program product of claim 1, furthercomprising: prior to repairing the system, receiving user authorizationto take the corrective action.
 7. The computer program product of claim1, wherein the computing system is one of: (i) a virtual machine, or(ii) an operating system.
 8. The computer program product of claim 7,wherein the computing system is a virtual machine, wherein thecomputer-readable program code to analyze data of the monitoredcomputing system health status metrics to determine that the instabilityhas occurred further comprises: upon determining that a resource hasbeen exhausted: supporting an early return from a method duringexecution of the method; and notifying the virtual machine that theresource has been exhausted.
 9. A system, comprising: one or morephysical computer processors; and a memory containing a program, whichwhen executed by the one or more physical computer processors isconfigured to perform an operation comprising: monitoring a set ofhealth status metrics of a system at a first level; analyzing data ofthe monitored health status metrics to determine that an instability hasoccurred when the data exceeds defined bounds for the computing systemhealth status metrics; responding to the instability by monitoringadditional health status metrics, whereby a level of monitoring of thesystem is increased from the first level to a second level, greater thanthe first level; repairing the system by taking corrective action basedon the instability; and refraining from monitoring at least one of theset of monitored health status metrics to reduce the level of monitoringto a third level once the instability has been resolved, wherein thethird level is less than the second level.
 10. The system of claim 9,wherein a user defines the sets of health status metrics to be monitoredand the bounds used to determine that an instability has occurred. 11.The system of claim 9, wherein the health status metrics monitored atthe first level of monitoring comprise health status metrics of acentral processing unit (CPU), a system memory, a system networkactivity, and a system input/output interface.
 12. The system of claim9, wherein monitoring further comprises: monitoring no health statusmetrics during a period of virtual machine stability.
 13. The system ofclaim 9, further comprising writing to a system log the additionalhealth status metrics monitored, the instability, the corrective actiontaken, and an associated effect on virtual machine stability for futureuse, wherein the system log is referenced to identify the health statusmetrics monitored and corrective actions taken to repair similarinstabilities such that effective actions are repeated, and ineffectiveactions are not repeated.
 14. The system of claim 9, further comprising:prior to repairing the virtual machine, receiving user authorization totake the corrective action.
 15. The system of claim 9, wherein thecomputing system is one of: (i) a virtual machine, or (ii) an operatingsystem.
 16. The system of claim 15, wherein the computing system is avirtual machine, wherein analyzing data of the monitored health statusmetrics to determine that the instability has occurred furthercomprises: upon determining that a resource has been exhausted:supporting an early return from a method during execution of the method;and notifying the virtual machine that the resource has been exhausted.17. The system of claim 9, wherein the computing system is a Javavirtual machine.